﻿using UnityEngine;

public class Fan : MonoBehaviour
{
    private GameObject wind;
    private BoxCollider2D boxCollider_wind;

    private bool _Active;
    public bool Active
    {
        get => _Active;
        set
        {
            if (value == _Active)
                return;
            _Active = value;
            wind.SetActive(value);
            boxCollider_wind.enabled = value;
        }
    }

    private void Awake()
    {
        wind = transform.GetChild(0).gameObject;
        boxCollider_wind = wind.GetComponent<BoxCollider2D>();
        Active = wind.activeSelf;
    }
}
